Interaction.ExtensionData Property

Gets the extension data.

Parent Type: Interaction

Namespace: Microsoft.LearningComponents.DataModel

Assembly: Microsoft.LearningComponents.dll

Syntax
C#

public IDictionary<string,object> ExtensionData

{ get; }
Remarks

Extension data does not correspond to any SCORM defined variables. It is used to store information on a per activity basis that cannot be stored in SCORM specifc variables.

Only certain types of data are valid within the extension data. These include Boolean, Int32, DateTime, Double, String, and byte[] array. If a Single is passed, this will automatically be converted to a Double.

All keys into this dictionary are unique, and if the same key is used twice it will overwrite the value and possibly the type information associated with that element. SCORM naming conventions are recommended but not required for key (i.e. variable) names.

Example

C#
// assigns a boolean value of true to "foo.bar.something"
session.CurrentActivityDataModel.ExtensionData["foo.bar.something"] = true;
 
// assigns a double value of 3.1415927 to "foo.bar.something"
// this changes the type as well as the value of the variable "foo.bar.something"
session.CurrentActivityDataModel.ExtensionData["foo.bar.something"] = 3.1415927
C#
byte[] attachment = ReadFileAsByteArray("c:\\assignment.doc");
session.CurrentActivityDataModel.ExtensionData["foo.bar.attachment"] = attachment;